{template 'public/header'}

{template 'public/comhead'}

<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcss.css">

<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li class="active"><a href="javascript:void(0);">订单设置</a></li>
    <li><a href="{php echo $this->createWebUrl('order');}"><i class="fa fa-refresh"></i>返回订单列表</a></li>
</ul>
<div class="main ygmain">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">

            <div class="panel-heading wyheader">

                订单设置

            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label  class="col-sm-2 control-label">租赁设置</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" id="zlsz1" name="zlsz" value="1" {if $info['zlsz']=='1' || empty($info['zlsz'])}checked{/if} />
                            <label for="zlsz1">租赁方式一</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="zlsz2" name="zlsz" value="0" {if $info['zlsz']=='0'}checked{/if} />
                            <label for="zlsz2">租赁方式二</label>
                        </label>
                        <span class="help-block">*方式一为：当用户租车后，前端还会显示，只是该时间段无法被下单。</span>
                        <span class="help-block">*方式二为：当用户租车后，该车辆就会下架，其他人无法看到车辆。</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">取车前几天可退款</label>
                    <div class="col-sm-9">
                        <input type="text" name="istui" class="form-control" value="{$info['istui']}" placeholder="0 为取车前都可退"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">退款百分比</label>
                    <div class="col-sm-9">
                        <input type="text" name="tuimoney" class="form-control" value="{$info['tuimoney']}" placeholder="1-100,100为全额退款，1为退款1%"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">待付款自动关闭订单</label>
                    <div class="col-sm-9">
                        <input type="number" name="close_time" class="form-control" value="{$info['close_time']}" placeholder="时间单位：分钟"/>
                    </div>
                </div>

                <div class="form-group">
                    <label  class="col-sm-2 control-label">小时结算规则</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" id="hour_type1" name="hour_type" value="1" {if $info['hour_type']=='1' || empty($info['hour_type'])}checked{/if} />
                            <label for="hour_type1">规则一</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="hour_type2" name="hour_type" value="0" {if $info['hour_type']=='2'}checked{/if} />
                            <label for="hour_type2">规则二</label>
                        </label>
                        <span class="help-block">*规则一：超出小时按日租金平均值来收取</span>
                        <span class="help-block">*规则二：超出小时，4小时内算半天，4小时以上按一天算</span>
                    </div>
                </div>

                <div class="form-group">
                    <label  class="col-sm-2 control-label">每笔交还车员佣金规则</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" id="shuttle_type1" name="shuttle_type" value="1" {if $info['shuttle_type']=='1' || empty($info['shuttle_type'])}checked{/if} />
                            <label for="hour_type1">规则一</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="shuttle_type2" name="shuttle_type" value="2" {if $info['shuttle_type']=='2'}checked{/if} />
                            <label for="hour_type2">规则二</label>
                        </label>
                        <span class="help-block">*规则一：交车员每笔订单佣金按照订单总额百分比抽取，如果是按照规则一，下面则设置0-100数值内</span>
                        <span class="help-block">*规则二：交车员每笔订单佣金按照固定值收取</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">每笔交还车员佣金</label>
                    <div class="col-sm-9">
                        <input type="text" name="shuttle_commission" class="form-control" value="{$info['shuttle_commission']}" placeholder="统一设置每笔订单交还车佣金"/>
                    </div>
                </div>
<!--                <div class="form-group">-->
<!--                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">长租订单预付金额</label>-->
<!--                    <div class="col-sm-3">-->
<!--                        <input type="text" name="long_prepay" class="form-control" value="{$info['long_prepay']}" placeholder="0 为全额"/>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="form-group">-->
<!--                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">短租订单预付金额</label>-->
<!--                    <div class="col-sm-3">-->
<!--                        <input type="text" name="short_prepay" class="form-control" value="{$info['short_prepay']}" placeholder="0 为全额"/>-->
<!--                    </div>-->
<!--                </div>-->
                <div class="form-group">
                    <h4 style="color: red;font-size: 17px; margin-left: 150px" >* 预付金额设置为0，前端付款时支付的是合计总金额</h4>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">订单押金</label>
                    <div class="col-sm-9">
                        <input type="text" name="deposit" class="form-control" value="{$info['deposit']}" placeholder="0为不需要押金"/>
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-2 control-label">押金退还渠道</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" id="depositway1" name="depositway" value="1" {if $info['depositway']=='1' || empty($info['depositway'])}checked{/if} />
                            <label for="depositway1">线上</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="depositway2" name="depositway" value="0" {if $info['depositway']=='0'}checked{/if} />
                            <label for="depositway2">线下</label>
                        </label>
                        <span class="help-block">*线上：后台点击审核通过，直接通过微信退款到用户账户，默认退还全部押金</span>
                        <span class="help-block">*线下：后台点击审核通过，不直接通过微信退款，默认线下操作的退款</span>
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-2 control-label">是否开启车辆续租</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" id="open_xz1" name="open_xz" value="1" {if $info['open_xz']=='1' || empty($info['open_xz'])}checked{/if} />
                            <label for="open_xz1">开启</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="open_xz2" name="open_xz" value="0" {if $info['open_xz']=='0'}checked{/if} />
                            <label for="open_xz2">关闭</label>
                        </label>
                        <span class="help-block">*开启后需填写到期前多少小时可续租，并且开启车辆单独开关才可续租。</span>
                    </div>
                </div>
                 <div class="form-group">
                    <label class="col-sm-2 control-label">车辆续租前时间限制  </label>
                    <div class="col-sm-9">
                        <input type="text" name="xztime" class="form-control" value="{$info['xztime']}" style="width: 740px;"/>
                        <span class="help-block">*到期前多少小时可续租。如填写6，车辆到期时间为晚上六点整，那就必须在中午十二点前才可申请续租。单位：小时</span>

                    </div>
                </div>
                <div class="form-group" >
                    <label class="col-sm-2 control-label">发票类型</label>
                    <div class="col-sm-9">
                        <input type="checkbox" name="invoice[]" value="1" {if in_array(1,$info['invoice'])} checked {/if} >普通发票</input>
                        <input type="checkbox" name="invoice[]" value="2" {if in_array(2,$info['invoice'])} checked {/if} >电子发票</input>
                        <span class="help-block">*普通发票：普通发票需要给有户邮寄。</span>
                        <span class="help-block">*电子发票：需要用户输入邮箱进行发送。</span>
                    </div>
                </div>
                <div class="form-group" >
                    <label class="col-sm-2 control-label">发票税率</label>
                    <div class="col-sm-9">
                        <input type="text" name="invoice_rate" class="form-control" value="{$info['invoice_rate']}" placeholder="发票税率，0-100之间"/>
                    </div>
                </div>
                <div class="form-group" >
                    <label class="col-sm-2 control-label">发票邮费</label>
                    <div class="col-sm-9">
                        <input type="text" name="invoice_postage" class="form-control" value="{$info['invoice_postage']}" placeholder="普通发票需要用户支付邮费"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">发票内容</label>
                    <div class="col-sm-9">
                        <div class="input-group" style="width: 1000px;">
                            {if $info['invoice_content']}
                            {loop $invoice_content $index $item}
                            <div class="actime" style="display: inline-block;width: 900px;">
                                <input class="form-control" name="invoice_content[]"  value="{$item}"  placeholder="请输入发票内容" style="display: inline-block;width:400px;">
                                <div style="width: 100px;display: inline-block;height: 30px;border-radius: 2px;">
                                    <button type="button" class="storespan btn btn-xs addSpec" style="height: 35px;width: 35px;margin-top: -1px;">添加</button>
                                    <button type="button" class="storespan btn btn-xs delSpec" style="height: 35px;width: 35px;margin-top: -1px;">删除</button>
                                </div>
                            </div>
                            {/loop}
                            {else}
                            <div class="actime" style="display: inline-block;width: 800px;margin-bottom: 2px;">
                                <input class="form-control" name="invoice_content[]"  value="" id="" placeholder="请输入发票内容" style="display: inline-block;width:400px;">
                                <div style="width: 100px;display: inline-block;height: 30px;border-radius: 2px;">
                                    <button type="button" class="storespan btn btn-xs addSpec" style="height: 35px;width: 35px;margin-top: -1px;">添加</button>
                                    <button type="button" class="storespan btn btn-xs delSpec" style="height: 35px;width: 35px;margin-top: -1px;">删除</button>
                                </div>
                            </div>
                            {/if}
                        </div>
                    </div>
                </div>

                <!--<div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">证件信息上传开关</label>
                    <div class="col-sm-9">
                            <input type="checkbox" id="zj0" name="zj[]" {if in_array('0',$zj)}checked="checked"{/if} value="0">
                            <label for="zj0">身份证号</label>
                            <input type="checkbox" id="zj1" name="zj[]" {if in_array('1',$zj)}checked="checked"{/if} value="1">
                            <label for="zj1">身份证正反面</label>
                            <input type="checkbox" id="zj2" name="zj[]" {if in_array('2',$zj)}checked="checked"{/if} value="2">
                            <label for="zj2">驾驶证正面、附页</label>
                            <input type="checkbox" id="zj3" name="zj[]" {if in_array('3',$zj)}checked="checked"{/if} value="3">
                            <label for="zj3">手持身份证自拍照</label>

                        <span class="help-block">*这里勾选需上传的证件信息 </span>
                    </div>
                </div>-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">基础服务费说明</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('service_desc',$info['service_desc']);}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">尊享服务费说明</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('zx_service_desc',$info['zx_service_desc']);}
                    </div>
                </div>
  <!--              <div class="form-group">
                    <label class="col-sm-2 control-label">取车须知</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('know',$info['know']);}
                    </div>
                </div>-->
                <!--<div class="form-group">
                    <label class="col-sm-2 control-label">取车证件说明</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('getcar_desc',$info['getcar_desc']);}
                    </div>
                </div>-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">订单说明</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('rule',$info['rule']);}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">租车合同</label>
                    <div class="col-sm-9">
                        {php echo tpl_ueditor('zchetong',$info['zchetong']);}
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">

            <input type="submit" name="submit" value="保存设置" class="btn col-lg-3" style="color: white;background-color: #444444;margin-left: 550px;"/>

            <input type="hidden" name="token" value="{$_W['token']}" />
            <input type="hidden" name="id" value="{$info['id']}" />

        </div>

    </form>

</div>
<script type="text/javascript">
    $(function(){
        $("#frame-2").show();
        $("#yframe-2").addClass("wyactive");
    })
    $(document).ready(function(){
        //点击追加
        $('.input-group').on('click','.addSpec',function () {
            //1.把当前的tr克隆一份
            $(this).parents('.actime .sku_id').val('');
            var newTr = $(this).parents('.actime').clone();
            //2.追加
            newTr.find('input[type="text"]').val('');
            newTr.find('input[type="hidden"]').val('');
            $(this).parents('.actime').after(newTr);
        })
        //删除
        $(".input-group").on("click",".delSpec",function(){
            $(this).parents('.actime').remove();
        });

    })
</script>